#include <bits/stdc++.h>

#define eb emplace_back
#define ep emplace
#define fi first
#define se second
#define in read<int>()
#define lin read<ll>()
#define rep(i, x, y) for(int i = (x); i <= (y); i++)
#define per(i, x, y) for(int i = (x); i >= (y); i--)

using namespace std;

using ll = long long;
using db = double;
using pii = pair < int, int >;
using vec = vector < int >;
using veg = vector < pii >;

template < typename T > T read() {
	T x = 0; bool f = 0; char ch = getchar();
	while(!isdigit(ch)) f |= ch == '-', ch = getchar();
	while(isdigit(ch)) x = x * 10 + (ch ^ 48), ch = getchar();
	return f ? -x : x;
}

template < typename T > void chkmax(T &x, const T &y) { x = x > y ? x : y; }
template < typename T > void chkmin(T &x, const T &y) { x = x < y ? x : y; }

const int N = 2e5 + 10;

int n, m, Q;
int w[N];
vec G[N], T[N];

namespace Tarjan {
	int dfn[N], low[N], stk[N], top, cnt, tim;
	void dfs(int x) {
		dfn[x] = low[x] = ++tim; stk[++top] = x;
		for(auto y : G[x])
			if(!dfn[y]) {
				dfs(y); chkmin(low[x], low[y]);
				if(dfn[x] == low[y]) {
					++cnt; int t;
					do {
						t = stk[top--];
						T[cnt].eb(t); T[t].eb(cnt);
					} while(t != y);
					T[cnt].eb(x), T[x].eb(cnt);
				}
			} else chkmin(low[x], dfn[y]);
	}
	void solve() {
		rep(i, 1, n) if(!dfn[i]) dfs(i);
	}
}

using Tarjan :: cnt;

int val[N], ind[N];

const int inf = 0x3f3f3f3f;

namespace seg {
	int val[N << 2];
	void pu(int o) { val[o] = min(val[o << 1], val[o << 1 | 1]); }
	void build(int o = 1, int l = 1, int r = cnt) {
		if(l == r) return val[o] = ::val[ind[l]], void(); int mid = l + r >> 1;
		build(o << 1, l, mid), build(o << 1 | 1, mid + 1, r); pu(o);
	}
	void upd(int pos, int v, int o = 1, int l = 1, int r = cnt) {
		if(l == r) return val[o] = v, void(); int mid = l + r >> 1;
		if(pos <= mid) upd(pos, v, o << 1, l, mid); else upd(pos, v, o << 1 | 1, mid + 1, r); pu(o);
	}
	int query(int xl, int xr, int o = 1, int l = 1, int r = cnt) {
		if(xl <= l && xr >= r) return val[o]; int mid = l + r >> 1, ret = inf;
		if(xl <= mid) chkmin(ret, query(xl, xr, o << 1, l, mid));
		if(xr > mid)  chkmin(ret, query(xl, xr, o << 1 | 1, mid + 1, r));
		return ret;
	}
}

namespace Tree {
	multiset < int > allson[N];
	int dfn[N], tim, fa[N], top[N], son[N], siz[N], dep[N];
	void updval(int x, int v) {
		if(fa[x]) {
			allson[fa[x]].erase(allson[fa[x]].find(w[x]));
			w[x] = v;
			allson[fa[x]].insert(v);
			val[fa[x]] = *allson[fa[x]].begin();
			seg :: upd(dfn[fa[x]], val[fa[x]]);
		} w[x] = val[x] = v;
		seg :: upd(dfn[x], val[x]);
	}
	int query(int x, int y) {
		//cerr << x << " " << y << endl;
		int ret = inf;
		while(top[x] != top[y]) {
			//cerr << x << " " << y << endl;
			if(dep[top[x]] < dep[top[y]]) swap(x, y);
			chkmin(ret, seg :: query(dfn[top[x]], dfn[x]));
			x = fa[top[x]];
		}
		if(dfn[x] > dfn[y]) swap(x, y);
		chkmin(ret, seg :: query(dfn[x], dfn[y]));
		if(x > n) chkmin(ret, val[fa[x]]);
		return ret;
	}
	void dfs(int x, int p) {
		fa[x] = p; siz[x] = 1; son[x] = 0; dep[x] = dep[p] + 1;
		for(auto y : T[x]) if(y != fa[x]) {
				dfs(y, x); siz[x] += siz[y];
				if(siz[y] > siz[son[x]]) son[x] = y;
				if(x > n) allson[x].ep(w[y]);
			}
		if(x > n) { if(allson[x].size()) val[x] = *allson[x].begin(); }
		else val[x] = w[x];
	}
	void dfs1(int x, int anc) {
		dfn[x] = ++tim; ind[tim] = x; top[x] = anc; if(son[x]) dfs1(son[x], anc);
		for(auto y : T[x]) if(y ^ son[x] && y ^ fa[x]) dfs1(y, y);
	}
	void init() {
		dfs(1, 0); dfs1(1, 1);
		//cerr << cnt << " " << tim << endl;
		//rep(i, 1, cnt) cerr << i << " : " << top[i] << " " << fa[i] << endl;
		seg :: build();
	}
}

int main() {
#ifdef YJR_2333_TEST
	freopen("1.in", "r", stdin);
#endif
	n = in, m = in, Q = in; cnt = n;
	rep(i, 1, n) w[i] = in;
	rep(i, 1, m) {
		int a = in, b = in;
		G[a].eb(b), G[b].eb(a);
	}
	Tarjan :: solve();
	Tree :: init();
	auto getch = [&]() {
		char ch = getchar();
		while(!isalpha(ch)) ch = getchar();
		return ch;
	};
	while(Q--) {
		char op = getch();
		int a = in, b = in;
		if(op == 'C') Tree :: updval(a, b);
		else printf("%d\n", Tree :: query(a, b));
	}
	return 0;
}
